Skip to content

Conversation

jssmith
Copy link
Contributor

@jssmith jssmith commented Apr 22, 2025

This is a draft implementation of optimization by LLM.

response = client.chat.completions.create(
model="gpt-4o",
response_model=IndexingAlternative,
temperature=1.2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure you want above average "temperature"? May make it too "creative"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no way to know what the right value is without testing. My inclination is to err on the creative side so that we explore the space of indexing recommendations. I have occasionally seen recommendations that refer to tables that don't exist or are otherwise invalid. They get rejected and my guess is that having some of that is healthy.

else:
remaining_attempts_prompt = ""

response = client.chat.completions.create(
Copy link
Contributor

@rahulcap rahulcap Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider litellm to not hardcode the model https://docs.litellm.ai/#basic-usage . They seem to map various apis to the open-ai completion format so rest of code shouldn't need to change, and it will pull api key from standard env variables (per provider)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need to put in code to switch the the desired model, right?

I.e., somewhere we need to see what is available, say via env variables, and then use that model. I don't think LiteLLM will do that for us.

Copy link

@mcrystaldba mcrystaldba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jssmith Thanks. LGTM.

@jssmith jssmith marked this pull request as ready for review April 24, 2025 18:35
@jssmith jssmith merged commit c6c0010 into main Apr 24, 2025
1 check passed
@jssmith jssmith deleted the DBA-738-Index-optimization-by-LLM branch April 24, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants